<template>
  <div class="main-page">
    <el-container class="main-content">
      <el-aside :width="isCollapse ? '64px' : '200px'">
        <main-menu :is-fold="isCollapse" />
      </el-aside>
      <el-container>
        <el-header>
          <main-header @fold-change="handleFoldChange" />
        </el-header>
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import MainHeader from '@/components/main-header/main-header.vue';
import { ref } from 'vue';

const isCollapse = ref(false);
function handleFoldChange(isFold: boolean) {
  isCollapse.value = isFold;
}
</script>

<style scoped lang="scss">
.main-page {
  height: 100%;
  .main-content {
    height: 100%;

    .el-aside {
      overflow-x: hidden;
      overflow-y: auto;
      line-height: 200px;
      text-align: left;
      cursor: pointer;
      background-color: #001529;
      transition: width 0.3s linear;
      scrollbar-width: none; /* firefox */
      -ms-overflow-style: none; /* IE 10+ */

      &::-webkit-scrollbar {
        display: none;
      }
    }

    .el-main {
      background-color: #f0f2f5;
      overflow-y: auto;
    }
  }
}
</style>
